package com.slz3.business.module.memberManagement.userScoreRecord.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.userScoreRecord.domain.UserScoreRecord;
import com.slz3.business.module.memberManagement.userScoreRecord.domain.UserScoreRecordCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class UserScoreRecordResController extends UserScoreRecordResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, UserScoreRecord userScoreRecord) {
        if (UserScoreRecordResUnsafeValid.add(req, userScoreRecord)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$UserScoreRecordUpdateLock(req, userScoreRecord);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        if (UserScoreRecordResUnsafeValid.delete(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, UserScoreRecord userScoreRecord) {
        if (UserScoreRecordResUnsafeValid.modify(req, userScoreRecord)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$UserScoreRecordUpdateLock(req, userScoreRecord);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (UserScoreRecordResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return userScoreRecordResAtomic.info_$UserScoreRecordUpdateLock(req);
        if (UserScoreRecordResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$UserScoreRecordUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (UserScoreRecordResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        //
        if (UserScoreRecordResUnsafeValid.auditSubmit(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        if (UserScoreRecordResUnsafeValid.audit(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        if (UserScoreRecordResUnsafeValid.auditReject(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        if (UserScoreRecordResUnsafeValid.usingEnable(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, UserScoreRecordCondition userScoreRecordCondition) {
        if (UserScoreRecordResUnsafeValid.usingDisable(req, userScoreRecordCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$UserScoreRecordUpdateLock(req, userScoreRecordCondition);
        }
    }

}
